import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
function loadView (path) {
  return resolve => require(['@/views/' + path], resolve)
}
export default new Router({
  mode: 'hash',
  routes: [
    {
      path: '/',
      name: 'login',
      component: loadView('Login'),
      meta: { title: 'login.title' }
    },
    {
      path: '/register',
      name: 'register',
      component: loadView('Register'),
      meta: { title: 'register.title' }
    },
    {
      path: '/home',
      name: 'home',
      component: loadView('Home'),
      meta: { title: 'sitName' }
    },
    {
      path: '/settings',
      name: 'settings',
      component: loadView('Settings'),
      meta: { title: 'settings.title' }
    }
  ]
})
